Skip to content

Implement SMIL snapshot rendering#534

Merged
wieslawsoltes merged 9 commits into
masterfrom
codex/smil-snapshot-rendering
May 26, 2026
Merged

Implement SMIL snapshot rendering#534
wieslawsoltes merged 9 commits into
masterfrom
codex/smil-snapshot-rendering

Conversation

@wieslawsoltes

Copy link
Copy Markdown
Owner

Summary

This PR implements the SMIL Snapshot Rendering lane for static SVG animation snapshots. It moves the animation runtime beyond time-zero rendering by evaluating configured snapshot times, composing active animation intervals, routing animated values through the same style/resource paths used by static rendering, and refreshing W3C Chrome-backed baselines for the enabled animation rows.

The work is split into three commits:

  • bcc4ede3e implements the SMIL animation runtime behavior.
  • bcd3aad78 hardens renderer/resource parity needed by animated snapshots.
  • ab2531774 refreshes the W3C SMIL snapshot harness, baselines, and roadmap.

What Changed

SMIL animation runtime

  • Added broader SMIL timing support for repeat events, repeat(n) eventbase timing, self-sync recurrence, future syncbase start-time queries, restart truncation, finite max handling for indefinite intervals, and half-open active interval boundaries.
  • Expanded interpolation coverage for scalar values, number lists, path data, transform values, motion paths, colors, currentColor, and inherit.
  • Added fallback behavior for unsupported or non-interpolable values, including midpoint discreteness and to-only non-interpolable routing for class, display, href/resource, filter, unit, and enum attributes.
  • Preserved browser-like composition order for animateMotion plus animateTransform, including additive and non-additive combinations.
  • Preserved raw animation attribute strings so values such as currentColor, inherit, and resource references survive until runtime resolution.
  • Added namespace-aware animation attribute routing for href, xlink:href, xml:*, style, class, presentation attributes, and custom attributes.
  • Re-applies compatibility styles and invalidates style caches when animated class/style mutations affect selector resolution.

Rendering and resource parity

  • Rebinds same-document deferred paint servers after animated document cloning so animated gradients, currentColor, and local paint references resolve against the animated clone instead of the source document.
  • Improves gradient and pattern inheritance by checking whether attributes are explicitly declared rather than assuming default values were intentionally set.
  • Guards recursive patterns and non-invertible pattern transforms.
  • Hardens filter behavior for invalid color matrix values, negative blur/morphology inputs, and morphology kernel rounding.
  • Adds support for transformed use clip paths and marker suppression in temporary marker compilation.
  • Improves CSS clip: rect(...) parsing, including whitespace syntax, auto, px, and legacy comma-offset behavior.
  • Handles empty image data in the Skia asset loader without throwing.
  • Fixes spot-lit specular code generation/runtime parameter parity.

W3C harness and baselines

  • Adds explicit W3C animation seek times so enabled snapshot rows compare the same animation frame used by their Chrome references.
  • Updates the Chrome override capture script to read seek times from W3CTestSuiteTests, wait for a real iframe document, use an explicit capture-ready marker, avoid duplicate readiness callbacks, and simulate the pre-seek interaction needed by animate-elem-52-t.
  • Adds Chrome overrides for 58 enabled SMIL rows plus animate-pservers-grad-01-b, and refreshes filters-composite-05-f.
  • Enables the implemented W3C animation rows and keeps browser-runtime-only rows skipped with explicit reasons.
  • Updates the skipped-tests roadmap with the completed SMIL snapshot implementation status and remaining policy/runtime gaps.

Remaining Explicit Policy Skips

The remaining skipped SMIL rows are not hidden failures in enabled coverage:

  • Deprecated animateColor rows where modern Chrome captures the fixture as a no-op and the suite needs a non-Chrome static reference policy before enabling.
  • Browser runtime rows requiring hyperlink activation, access keys, wallclock timing, pointer hit-testing, hover/mouse event sequencing, or embedded animated image script/runtime behavior.
  • Deeper static parity rows such as animate-elem-90-b and animate-elem-91-t, where partial routing is covered but full selector guide-fill or display/use/resource parity remains broader than the static snapshot lane.

Validation

Ran the required local validation after implementation:

  • dotnet format Svg.Skia.slnx --no-restore
  • node --check scripts/capture_w3c_chrome_overrides.mjs
  • git diff --check
  • dotnet build Svg.Skia.slnx -c Release --no-restore
  • dotnet test tests/Svg.Skia.UnitTests/Svg.Skia.UnitTests.csproj -f net10.0 -c Release --no-restore --filter "FullyQualifiedName~SvgAnimationControllerTests"
  • dotnet test tests/Svg.Skia.UnitTests/Svg.Skia.UnitTests.csproj -f net10.0 -c Release --no-restore --filter "DisplayName~animate-"
  • dotnet test Svg.Skia.slnx -c Release --no-restore

Results:

  • Release build passed with existing warnings only.
  • SvgAnimationControllerTests: 72 passed.
  • W3C animation sweep: 63 passed, 17 explicit policy/runtime skips.
  • Full solution tests: 2190 W3C/Svg.Skia rows reported from Svg.Skia.UnitTests with 2122 passed and 68 explicit skips; all other project test assemblies passed.

Notes

  • externals/SVG was checked after formatting. Accidental submodule formatting churn was reverted, and the submodule is clean.
  • The PR summary file itself is intentionally left uncommitted per request.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab25317741

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Svg.Custom/Animation/SvgDocument.Animation.cs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f033c1005e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Svg.Animation/Animation/SvgAnimationController.cs
Comment thread src/Svg.Animation/Animation/SvgAnimationController.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 597b85cd87

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Svg.Custom/Animation/SvgElement.AnimationRuntime.cs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 21cdda7536

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Svg.Custom/Animation/SvgElement.AnimationRuntime.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant